import { createRouter, createWebHistory } from 'vue-router'

import { useI18n } from 'vue-i18n'
import TabsView from '../views/tabs/TabsView.vue'
import PCTabsView from '../views/PCtab/PCTabsView.vue'
import homePcView from '../views/PCtab/homePc/homePcView.vue'

import topUpView from '../views/PCtab/topUp/topUpView.vue'
import gameDetailsView from '../views/PCtab/gameDetails/gameDetailsView.vue'

import gameCenterView from '../views/PCtab/gameCenter/gameCenterView.vue'

import HomeView from '../views/tabs/home/HomeView.vue'
import GameView from '../views/tabs/game/GameView.vue'
import ApplicationView from '../views/tabs/Application/ApplicationView.vue'

import ApplicationListView from '../views/applicationList/ApplicationListView.vue'
import gameDetailsMoblie from '../views/ApplicationDetails/ApplicationDetailsView.vue'
import reviewListView from '../views/ApplicationDetails/reviewList/reviewListView.vue'
import privacyAgreementView from '../views/privacyAgreement/privacyAgreementView.vue'
import privacypolicyView from '../views/privacypolicy/privacypolicyView.vue'
import termServiceView from '../views/termService/termServiceView.vue'
import AboutUsView from '../views/AboutUs/AboutUsView.vue'
import contactusView from '../views/contactus/contactusView.vue'
import otherstatementView from '../views/otherstatement/otherstatementView.vue'

// const i18n = useI18n()
const router = createRouter({
  history: createWebHistory('/user/pc'),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    // {
    //   name: 'ApplicationDetails',
    //   path: '/ApplicationDetails',
    //   component: ApplicationDetailsView,
    // },
    {
      name: 'reviewList',
      path: '/reviewList',
      component: reviewListView,
    },
    {
      name: 'privacypolicy',
      path: '/privacypolicy',
      component: privacypolicyView,
    },
    {
      name: 'termService',
      path: '/termService',
      component: termServiceView,
    },

    {
      name: 'otherstatement',
      path: '/otherstatement',
      component: otherstatementView,
    },
    {
      name: 'AboutUs',
      path: '/AboutUs',
      component: AboutUsView,
    },
    {
      name: 'contactus',
      path: '/contactus',
      component: contactusView,
    },

    {
      name: 'privacyAgreement',
      path: '/privacyAgreement',
      component: privacyAgreementView,
    },
    {
      path: '/PC',
      name: 'PC',
      component: PCTabsView,
      children: [
        { name: 'home', path: '/home', component: homePcView },
        { name: 'game', path: '/game', component: gameCenterView },
        { name: 'gameDetails', path: '/gameDetails', component: gameDetailsView },
        {
          name: 'topUp',
          path: '/topUp',
          component: topUpView,
        },
      ],
    },
    {
      path: '/moblie',
      name: 'moblie',
      component: TabsView,
      children: [
        { name: 'homeMoblie', path: '/moblie/home', component: HomeView },
        { name: 'gameMoblie', path: '/moblie/game', component: GameView },
        {
          name: 'gameDetailsMoblie',
          path: '/moblie/gameDetailsMoblie',
          component: gameDetailsMoblie,
        },
        {
          name: 'ApplicationListMoblie',
          path: '/moblie/ApplicationListView',
          component: ApplicationListView,
        },

        { name: 'applicationMoblie', path: '/moblie/application', component: ApplicationView },
      ],
    },
  ],
})

router.afterEach(() => {
  window.scrollTo(0, 0) //滚动条至于浏览器顶部
})
export default router
